// @ts-ignore
/* eslint-disable */
import request from "@/util/request.ts";

/** 此处后端没有提供注释 POST /readingRoom/add */
export async function addReadingRoom(
  body: API.AddReadingRoomRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>("/readingRoom/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /readingRoom/delete/${param0} */
export async function deleteReadingRoom(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteReadingRoomParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/readingRoom/delete/${param0}`, {
    method: "POST",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /readingRoom/get/${param0} */
export interface ReadingRoomDetail {
  id: string;
  roomname: string;
  imageurl: string;
  description: string;
  openinghours: string;
  currentcount: number;
  totalseats: number;
  seatstatus: string;
  createtime: string;
  updatetime: string;
  isdelete: number;
}

export const getReadingRoomById = (id: string) => {
  return request<ReadingRoomDetail>({
    url: `/readingRoom/get/${id}`,
    method: 'GET',
  });
};

/** 此处后端没有提供注释 GET /readingRoom/list */
export async function listReadingRoom(options?: { [key: string]: any }) {
  return request<API.BaseResponseListReadingRoom>("/readingRoom/list", {
    method: "GET",
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /readingRoom/update */
export async function updateReadingRoom(
  body: API.UpdateReadingRoomRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>("/readingRoom/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
